package com.jess.arms.base.my;

import com.jess.arms.mvp.IView;

import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;


/**
 * 无效果请求网络回调
 *
 * @param <T>
 */
public abstract class BaseNoLoadingSubscriber<T> extends BaseSubscriber<T> {

    public BaseNoLoadingSubscriber(IView mRootView) {
        super(mRootView);
    }

    @Override
    public void onSubscribe(Disposable d) {

    }

    @Override
    public void onNext(BaseEntity<T> tBaseEntity) {
        if (tBaseEntity.isSuccess())
            onRequestSuccess(tBaseEntity.getData());
        else
            onRequestError(tBaseEntity.getMsg());
    }

    @Override
    public void onError(Throwable t) {
        onRequestError(t.getMessage());
    }

    @Override
    public void onComplete() {

    }


}
